$(function(){

	$('#btnOrder').click(function(){

		var data={
			id:$('#proid').val(),
			buyNum:$('#buyNum').val(),
			address:$('#address').val(),
			receiver:$('#receiver').val(),
			phone:$('#phone').val(),
			orderType:'拼团',
		};

		console.log(data);
		//return false;
		var postUrl='/wx/pgroup/order/create';
		$.ajax({
            type: "post",
            url: postUrl,
            data: data,
            dataType: 'JSON',
            async: false,
            success: function(response)
            {
            	if(response.resultCode=='0')
            	{
            		alert('订单提交成功')
            		setTimeout(function(){
            			window.location.href="/wx/pgroup/myorder";
            		},2000)
            	}else
            	{
            		alert('订单提交失败')
            	}
            },
            error:function()
            {
            },
            complete: function()
            {
            },
        });
	})
})